home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DATETIME.SWG / 0030_TOMORROW in BASM.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  1KB  |  39 lines

  1. {
  2. From: ERIK HJELME
  3. Subj: date of tomorrow
  4.  
  5. I know you've got answers about how to calculate the date of
  6. tomorrow, but as DOS take care of almost anything in life it
  7. will offer to do this for you too : }
  8.  
  9. var
  10.   yy           : word;
  11.   mm,dd,ww     : byte;
  12.  
  13. begin   asm
  14.         mov     ah,$2A
  15.         int     $21     { request todays date }
  16.         push    dx      { store todays date   }
  17.         push    cx      { store todays year   }
  18.  
  19.         mov     ax,$40  { pretend midnight has been passed }
  20.         mov     es,ax
  21.         inc     byte ptr es:[$0070]
  22.  
  23.         mov     ah,$2A
  24.         int     $21     { request todays date, DOS will calculate
  25.                           the next available date ie tomorrow    }
  26.  
  27.         mov     yy,cx   { year  }
  28.         mov     mm,dh   { month }
  29.         mov     dd,dl   { date  }
  30.         mov     ww,al   { day_of_week }
  31.  
  32.         mov     ah,$2b
  33.         pop     cx      { retrieve year }
  34.         pop     dx      { retrieve date }
  35.         int     $21     { restore date  }
  36.         end;
  37. end;
  38.  
  39.